package com.wwj.mapper;


import com.wwj.pojo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {


    //用户注册
    @Insert("INSERT INTO user (name, username, password, phone, sex, id_number, create_time)" +
            "VALUES " +
            "(#{name},#{username},#{password},#{phone}, #{sex},#{idNumber},#{createTime}) ")
    void register(User user);

    //查询全部用户
    @Select("select count(id) from user where username=#{username}")
    Integer selectUser(String username);

    @Select("select * from user where username=#{username}")
    User selectByUsername(String username);

    //修改用户
    void updateUser(User user);
}
